<template>
	<view class="goods_list">
		<view class="goods_item" v-for="good in hotGoods" :key="good.id" @click="navigator(good.id)">
			<image :src="good.img_url" mode=""></image>
			<view class="price"> 	
				<text>￥{{good.sell_price}}</text>
				<text>￥{{good.market_price}}</text>
				</view>
			<view class="goods_name">
				{{good.title}}
			</view>
		</view>
		
	</view>
</template>

<script>
	export default{
		props:['hotGoods'],
		methods:{
			navigator(id){
				this.$emit('itemClick',id)
			}
		}
	}
</script>

<style lang="scss">
	.goods_list{
		padding: 0 15rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		margin: 10rpx 0; 
		.goods_item{
			background-color: #fff;
			width: 355rpx;
			margin: 10rpx 0;
			
			padding: 15rpx;
			box-sizing: border-box;
			image{
				width: 80%;
				height: 150px;
				display: block;
				margin: auto;
			}
			.price{
				margin: 20rpx 0 5rpx 0;
				color: #f00;
				font-size: 36rpx;
				text:nth-child(2){
					color: #ccc;
					font-size: 28rpx;
					margin-left: 17rpx;
					text-decoration: line-through;
					
					
				}
			
			}
			.goods_name{
				font-size: 28rpx;
				line-height: 50rpx;
				padding-top:10rpx;
				padding-bottom: 15rpx;
				
			}
		}
	}
</style>